this is the code, from most sources that I have seen, this should work
this is the entire file
const Discord = require("discord.js")
const TOKEN = ""
const client = new Discord.Client({
intents: [
"GUILDS",
"GUILD_MESSAGES"
]
})
client.on("ready", () => {
console.log('Logged in as ${client.user.tag}')
})
client.on("messageCreate", (message) => {
if (message.content == "hi") {
message.reply("Hello")
}
})
client.login(TOKEN)
Your intents are set incorrectly...
try this:
intents: [
Discord.Intents.FLAGS.GUILDS,
Discord.Intents.FALGS.GUILD_MESSAGES
]
About messageCreate:
If you need your bot to receive messages ( MESSAGE_CREATE - "messageCreate" in discord. js), you need the GUILD_MESSAGES intent. Done so like this:
Discord.Intents.FALGS.GUILD_MESSAGES